package com.org.controller.param;

import cn.hutool.json.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
 * @author Rainy-Heights
 * @version 1.0
 * @Date 2023/3/24 16:25
 */
@Controller
@RequestMapping("/mail")
public class TestController {

    @PostMapping("/get")
    public String sendAnEmail(@RequestBody JSONObject req){
        System.out.println(req.getStr("email"));
        return "/test";
    }

    @RequestMapping("/path")
    public String path(HttpServletRequest request){
        System.out.println(request.getParameter("email"));
        return "/test";
    }

    @GetMapping("/test")
    public String email(){
        return "/test";
    }
}
